package com.qianzhou.page.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: qian.zhou
 * @Description:
 * @Date Created in 2021-09-13-21:12
 * @Modified By:
 */
@RestController
@RequestMapping("config")
@RefreshScope  // 手动刷新 本次的手动的刷新是post的方式，并不是get的方式，如果是get的方式是405，请求方式不一样
// Config配置手动刷新
public class ConfigClientController {
    @Value("${user.username}")
    private String username;
    @Value("${user.password}")
    private String password;

    @RequestMapping("/remote")
    public String findRemoteConfig() {
        return username + " " + password;
    }
}
